﻿CREATE TABLE [dbo].[ContentBlocks] (
    [Id]                       INT  IDENTITY (1, 1) NOT NULL,
    [HTMLContent]              TEXT NULL,
    [SitePageId]               INT  NOT NULL,
    [ContentBlockDefinitionId] INT  NOT NULL,
    CONSTRAINT [PK_ContentBlocks] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_ContentBlocks_ContentBlocksDefinitions] FOREIGN KEY ([ContentBlockDefinitionId]) REFERENCES [dbo].[ContentBlockDefinitions] ([Id]),
    CONSTRAINT [FK_ContentBlocks_SitePages] FOREIGN KEY ([SitePageId]) REFERENCES [dbo].[SitePages] ([Id]) ON DELETE CASCADE ON UPDATE CASCADE
);

